//manage search box text

$(document).ready(function(){	
	$("#content").focus(function(){
		if($(this).attr("value") == "Enter search here...") $(this).attr("value", "");
	});
	$("#content").blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", "Enter search here...");
	});
});

$(document).ready(function(){	
	$("#local").focus(function(){
		if($(this).attr("value") == "City, State or Zip") $(this).attr("value", "");
	});
	$("#local").blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", "City, State or Zip");
	});
});

//******* START SEARCHJOB PAGE

function starHover(el,num) {
	//document.getElementById('number_star').value = "";
	var brightStar = document.getElementById('brightstar').value;
	var greyStar = document.getElementById('greystar').value;
	
	var nextStar;
	
	for(var i = 1; i < 6; i++){
		nextStar = document.getElementById(el+'_'+i);
		if(i <= num) {

			nextStar.src = brightStar;
		}
		else {
			nextStar.src = greyStar;
		}
	}
}

function starClick(element,num) {
	document.getElementById(element).value = num;
}

function starLeave(el,element) {
	var num;
	num = document.getElementById(element).value;

	starHover(el,num);
}

function changeSelect() {
	var select = document.getElementById("domain");
	var value = select.value;
	var specialist = document.getElementById("specialist");
	if(value=="Informatique") {

		for(var i=1;i<=4;i++) {
			specialist.options[i].style.display="block";
			if(i>=1 && i<=4)
				specialist.options[i].style.display="block";
			else
				specialist.options[i].style.display="none";
		}	
	}
	if(value=="Economie") {
		for(var i=1;i<=4;i++) {
			specialist.options[i].style.display="block";
			if(i>4)
				specialist.options[i].style.display="block";
			else
				specialist.options[i].style.display="none";
		}
	}
	if(value=="Agriculture") {
		for(var i=1;i<=4;i++) {
			specialist.options[i].style.display="block";
			if(i>4)
				specialist.options[i].style.display="block";
			else
				specialist.options[i].style.display="none";
		}
	}
	if(value=="Elevage") {
		for(var i=1;i<=4;i++) {
			specialist.options[i].style.display="block";
			if(i>4)
				specialist.options[i].style.display="block";
			else
				specialist.options[i].style.display="none";
		}
	}
}
  

//************* END SEARCHJOB PAGE


//************* START SIGNIN PAGE
function checkPassword() {
	var pass = document.getElementById("new_password").value;
	var c_pass = document.getElementById("c_password").value;
	if(pass!=c_pass) alert("Please make sure your passwords match.");
}
  
function forgot_password() {
	alert("Please enter your username, click Login and we will send you a new password.");
}

//**************END SIGNIN PAGE